<template>
  <el-dialog
    :title="name"
    :visible.sync="visible"
  >
    <el-form>
      <i class="el-form-item" v-for="item in dataList">{{ item }}</i>
    </el-form>
  </el-dialog>

</template>
<script>
export default {
  data () {
    return {
      visible: true,
      name: '',
      dataList: []
    }
  },
  created () {
  },
  methods: {
    getTableItems () {
      this.$http({
        url: this.$http.adornUrl('/get/hms_Chi_Eng/fields'),
        method: 'get',
        params: {tableName: this.name}
      }).then(({data}) => {
        if (data && data.code === 0) {
          this.dataList = data.data
        }
      })
    },
    init (name) {
      this.visible = true
      this.name = name
      this.$nextTick(() => {
        this.getTableItems()
      })
    }
  }
}
</script>
